#include <bits/stdc++.h>

using std::cin;
using std::cout;

namespace DataMaker {

typedef long long LL;

constexpr LL n = 1e5, q = 1e5;

inline int randint(int l, int r) { return rand() % (r - l) + l; }

inline int main() {
  cout << n << ' ' << q << '\n';
  for (int i = 0; i < n; ++i) cout << i << ' ';
  cout << '\n';
  for (int i = 1; i <= q; ++i) cout << randint(0, 10) << ' ';
  return 0;
}

}  // namespace DataMaker

int main() {
  freopen("/tmp/CodeTmp/testdata.in", "w", stdout);
  srand(time(nullptr));
  std::cerr << time(nullptr) << std::endl;
  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return DataMaker::main();
}